package pattern.factory_method.basic;

public class Test {
    public static void main(String[] args) throws Exception {
        Car benChi = CarFactory.createCar("BenChi");
        Car baoShiJie = CarFactory.createCar("BaoShiJie");
        Car faLaLi = CarFactory.createCar("FaLaLi");
        System.out.println(benChi.getName());
        System.out.println(baoShiJie.getName());
        System.out.println(faLaLi.getName());
        System.out.println(CarFactory.createCar("11"));
        System.out.println("=========================");

        Car baoshijie = CarFactory.createCar(BaoShiJie.class);
        System.out.println(baoshijie.getName());
    }
}
